[build] Download and bundle Selenium Manager SBOM and NOTICE in each package#17820
Conversation
6897e0a to
61c120e
Compare
PR Summary by QodoBundle Selenium Manager SBOM and NOTICE into all shipped packages
AI Description
Diagram
High-Level Assessment
Files changed (10)
|
Code Review by Qodo
1. Unchecked sha JSON keys
|
There was a problem hiding this comment.
Pull request overview
This PR extends the existing Selenium Manager “pinned artifact” download + packaging flow so that every distribution that ships the Selenium Manager binary also ships two compliance artifacts (CycloneDX SBOM + third-party NOTICE) alongside it.
Changes:
- Extend the Selenium Manager artifact downloader (
http_file) wiring to includeselenium-manager.cdx.jsonandselenium-manager-THIRD-PARTY-NOTICES.txt. - Add Bazel targets to copy those two artifacts into each binding’s packaged outputs (Java jar, Python wheel, Ruby gem, npm package, NuGet).
- Wire the new artifacts into the .NET nuspec and Bazel
nuget_packfile list.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| scripts/selenium_manager.py | Generates additional http_file rules for SBOM/NOTICE in the Selenium Manager artifacts extension. |
| common/selenium_manager.bzl | Adds download_sm_sbom/download_sm_notice http_file downloads alongside manager binaries. |
| MODULE.bazel | Exposes the new downloaded repos (download_sm_sbom, download_sm_notice) via use_repo. |
| common/manager/BUILD.bazel | Adds aliases for the SBOM/NOTICE artifacts for consumption by bindings. |
| py/BUILD.bazel | Copies SBOM/NOTICE into the wheel payload and excludes them from the sdist. |
| rb/BUILD.bazel | Copies SBOM/NOTICE into the gem payload under bin/. |
| javascript/selenium-webdriver/BUILD.bazel | Copies SBOM/NOTICE into the npm package payload under bin/ and includes them in npm_package. |
| java/src/org/openqa/selenium/manager/BUILD.bazel | Adds SBOM/NOTICE as jar resources next to the manager binaries. |
| dotnet/src/webdriver/BUILD.bazel | Includes SBOM/NOTICE in nuget_pack.files at NuGet package root. |
| dotnet/src/webdriver/Selenium.WebDriver.nuspec | Adds SBOM/NOTICE <file> entries so they’re included in the NuGet package. |
Comments suppressed due to low confidence (1)
common/manager/BUILD.bazel:43
- Same mismatch as the SBOM:
selenium-manager-noticealways points at the downloaded release artifact even when//common:pin_browsers=falsecauses linux/macos binaries to come from//rust:selenium-manager-*. That can bundle a NOTICE file that doesn't correspond to the binary actually being packaged.
alias(
name = "selenium-manager-notice",
actual = "@download_sm_notice//file",
)
🔗 Related Issues
💥 What does this PR do?
Bundles a CycloneDX SBOM and a third-party NOTICE alongside the Selenium Manager binary in every package that ships it — Python wheel, Java jar, Ruby gem, npm package, NuGet package.
The two files are generated once (cross-platform-complete) by the Selenium Manager release job in #17819 and published to the
selenium_manager_artifactsrelease. This PR downloads them with Bazelhttp_file— exactly like the binaries — and copies one of each into each package, next to the binary:org/openqa/selenium/manager/selenium/webdriver/common/bin/bin/selenium-manager.cdx.json— a CycloneDX SBOM inventorying the statically-linked Rust crates (name, version, checksum, dependency graph, SPDX license) for vulnerability and license scanning.selenium-manager-THIRD-PARTY-NOTICES.txt— the third-party attribution file reproducing each bundled crate's copyright notice and full license text, which MIT/BSD/ISC/Apache-2.0 require in binary distributions.🔧 Implementation Notes
scripts/selenium_manager.pygainsprint_sbom/print_notice,common/selenium_manager.bzladdsdownload_sm_sbom/download_sm_noticehttp_filerules, andcommon/managerexposesselenium-manager-sbom/-noticealiases.runtimes/<os>/native/.resources(jar), wheeldata(py),data(gem),srcs(npm),nuget_pack.files+ nuspec<file>(nuget).//rust:selenium_manager_srcs) rather than the compiled binary, so both files are excluded there — the same treatment the binaries get.🤖 AI assistance
💡 Additional Considerations
.dist-info/sboms/(PEP 770) for wheels andMETA-INF/sbom/for jars — because the pinnedrules_pythonpy_wheelcannot write into.dist-info/and the Java move would disturb the manager binary's resource-loading path. Deferred as a follow-up (gated onrules_pythonPEP 770 support) so a generic scanner can auto-discover the SBOM.cargo(cargo-cyclonedx + cargo-about) in the release job.🔄 Types of changes